<%@ page import="click.WebAction" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'webAction.label', default: 'WebAction')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.create.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${webActionInstance}">
            <div class="errors">
                <g:renderErrors bean="${webActionInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="saveAll" method="post" >
            <input type="hidden" name="websiteid"  value="${website.id}">
                <div class="dialog">
                    <table>
                        <tbody>
                         <tr>   
                                   <g:each in="${website.rate}" var="r">
                                   <td >
                                     ${r.rate}
                                    </td>   
                                   </g:each>
                            </tr> 
                            <tr>   
                                   <g:each in="${website.rate ? website.rate : 0..23}" var="hour">
                                   <td >
                                     <input type="text" name="rate" value="${hour in Integer ?  0 : hour?.rate}" size="2" style="width:20px;">
                                    </td>   
                                   </g:each>
                            </tr> 
                            <tr> 
                                <g:each in="${0..23}" var="hour">
                                   <td style="text-align:center">
                                    ${hour} 
                                    </td> 
                                   </g:each> 
                            </tr>
 
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
